﻿@{
    ViewData["Title"] = "新增编辑";
}
	<form id="myFormId" action="/wms/Menu/saveMenu" method="post" target="frmright">
	<div class="box1" id="formContent" whiteBg="true">
	<table class="tableStyle" formMode="transparent">
        <input type="hidden" name="editType" value="@ViewData["editType"]" />
		<input type="hidden" name="menuId" value="@ViewData["menuId"]" />
		<tr>
			<td width="150">菜单名称：</td>
			<td>
			<input type="text" name="menuName" @(ViewData["name"] == null ? "" : "readonly")
                value="@ViewData["name"]" class="validate[required]"/>
                <span class="star">*</span>
			</td>
		</tr>
		<tr>
			<td>父级菜单：</td>
			<td><select selectedValue="@ViewData["parentId"]" prompt="请选择" url="/wms/Menu/getSelectMenu" name="parentId"></select></td>
		</tr>
		<tr>
			<td>菜单链接：</td>
			<td><input type="text" name="url" value="@ViewData["url"]"/></td>
		</tr>
		<tr>
			<td>启用/禁用：</td>
			<td>
				<select selectedValue="@ViewData["enabled"]" name="enabled"  data='{"list":[{"value":"Y","key":"是"},{"value":"N","key":"否"}]}'></select>
			</td>
		</tr>
		<tr>
			<td>菜单排序：</td>
			<td><input type="text" inputMode="numberOnly" name="sortNum" value="@ViewData["sortNum"]"/></td>
		</tr>
		<tr>
			<td>菜单样式：</td>
			<td><input type="text" name="iconSkin" value="@ViewData["iconSkin"]"/></td>
		</tr>
		<tr>
			<td width="150">菜单图标路径：</td>
			<td><input type="text" name="iconUrl" value="@ViewData["iconUrl"]"/></td></td>
		</tr>
		<tr>
			<td width="150">菜单展开图标路径：</td>
			<td><input type="text" name="iconOpenUrl" value="@ViewData["iconOpenUrl"]"/></td></td>
		</tr>
		<tr>
			<td width="150">菜单闭合图标路径：</td>
			<td><input type="text" name="iconCloseUrl" value="@ViewData["iconCloseUrl"]"/></td></td>
		</tr>
		<tr>
			<td>菜单描述：</td>
			<td><input  type="text" name="description" value="@ViewData["description"]"/></td>
		</tr>
		<tr>
			<td colspan="2">
				<input type="button" value="提交" onclick="submitForm()"/>
				<input type="button" value="取消" onclick="top.Dialog.close()"/>
			</td>
		</tr>
	</table>
	</div>
	</form>
<!-- 异步提交start -->
<script type="text/javascript">
    function submitForm() {
        var valid = $('#myFormId').validationEngine({ returnIsValid: true });
        if (valid) {
            $('#myFormId').ajaxSubmit({
                //表单提交成功后的回调
                success: function (responseText, statusText, xhr, $form) {
                    top.Dialog.alert(responseText.message, function () {
                        if (responseText.flag == "OK") {
                            closeWin();
                        }
                    });
                }
            });
        } else {
            top.Dialog.alert("数据校验失败，请检查！", function () {
            });
        }
    }

    //重置
    function closeWin() {
        //刷新数据
        ﻿﻿var tabfrmId = "page_" + top.frmright.getCurrentTabId();
        top.frmright .document.getElementById(tabfrmId).contentWindow.refresh(false);
        //关闭窗口
        top.Dialog.close();
    }
</script>
<!-- 异步提交end -->	